﻿using LuaInterface;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LUALearn1 : MonoBehaviour
{
    public string luaResourcePath;
    LuaState mLuaState = null;


    void Awake()
    {
        mLuaState = new LuaState();
        mLuaState.Start();
        LuaBinder.Bind(mLuaState);//把各种unity的接口绑定进LUA.

        var textAsset = Resources.Load<TextAsset>(luaResourcePath);
        mLuaState.DoString(textAsset.text, "LUALearn1.cs");
    }

    void OnDestroy()
    {
        mLuaState.Dispose();
    }
}
